#ifndef _DEFTRACK_CTRACKERWINDOW_H_
#define _DEFTRACK_CTRACKERWINDOW_H_

#include <buola/gui/containers/cmosaiccontainer.h>
#include <buola/scene.h>
#include <buola/io/curi.h>
#include <buola/scene/geodes/cpointcloud.h>
#include <buola/app/ctimer.h>

#include "ctrackedobject.h"

namespace buola { namespace tracker {

class CTrackerWindow : public gui::CMosaicContainer
{
public:
    CTrackerWindow(const io::CURI &pURI);
    virtual ~CTrackerWindow();

private:
    void SetupWindow();
    void SetupInput();
    void SetupScene();
    void SetupViews();

    void DoPlay();
    void DoStep();
    
    void OnCommitHook(const CRegion &pRegion);

private:
    gui::PToolBar mToolBar;
    scene::PScene mCloudScene;
    scene::PScene mObjectScene;
    scene::PSceneView mCloudSceneView;
    scene::PSceneView mObjectSceneView;
    cvi::CCloud_rgb8 mCloud;
    scene::PPointCloud mSceneCloud;
    
    std::unique_ptr<CTrackedObject> mObject;
    io::CURI mURI;
    int mFrame;
    CTimer mTimer;
};

/*namespace tracker*/ } /*namespace buola*/ }

#endif
